package com.epigeon.amadeo.test2;

import android.app.Activity;
import android.os.Bundle;

import com.epigeon.amadeo.engine.Engine;
import com.epigeon.amadeo.engine.EngineConfiguration;
import com.epigeon.amadeo.impl.ActiveButton;
import com.epigeon.amadeo.impl.ActiveList;
import com.epigeon.amadeo.impl.PassiveEditText;
import com.epigeon.amadeo.impl.ReverseStringModifier;
import com.epigeon.amadeo.impl.UpperCaseStringModifier;

public class ListDemo extends Activity {
	
	public static final String TAG_LIST = "text_list";
	public static final String TAG_FIELD = "text_field";
	public static final String TAG_BUTTON = "add_button";
	public static final String TAG_MOD_SUPC = "string_upper_case";
	public static final String TAG_MOD_REV = "string_reverse";
	
    /** Called when the activity is first created. */	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ActiveButton button = (ActiveButton) findViewById(R.id.buton);
        ActiveList list = (ActiveList) findViewById(R.id.list);
        PassiveEditText text = (PassiveEditText) findViewById(R.id.text);

        Engine.getInstance().setEngineConfiguration(new EngineConfiguration(this, R.raw.amadeo));
        
        Engine.getInstance().registerOutput(ListDemo.TAG_LIST, list);
        Engine.getInstance().registerInput(ListDemo.TAG_LIST, list);
        Engine.getInstance().registerInput(ListDemo.TAG_BUTTON, button);
        Engine.getInstance().registerInput(ListDemo.TAG_FIELD, text);
        Engine.getInstance().registerModifier(TAG_MOD_SUPC, new UpperCaseStringModifier());
        Engine.getInstance().registerModifier(TAG_MOD_REV, new ReverseStringModifier());        
                
        button.addPassiveInput(text);
                
    }
}